package com.corpgovernment.common.enums;

import java.util.Arrays;
import java.util.Objects;

public enum OrderTypeEnum {

    CN("CN", "马上叫车", "3"),
    TN("TN", "火车票", "8"),
    HN("HN", "国内酒店", "2"),
    HI("HI", "海外酒店", "2"),
    FN("FN", "国内机票", "1"),
    FI("FI", "国际机票", "1"),
    CF("PN", "接送机", "1"),
    CT("PM", "接送站", "1")
    ;

    private String type;
    private String name;
    private String productLine;

    OrderTypeEnum(String type, String name, String productLine) {
        this.type = type;
        this.name = name;
        this.productLine = productLine;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public String getProductLine() {
        return productLine;
    }

    /**
     * 获取订单类型
     *
     * @param type
     * @return
     */
    public static OrderTypeEnum getByType(String type) {
        return Arrays.stream(OrderTypeEnum.values()).filter(e -> Objects.equals(e.getType(), type)).findFirst().orElse(null);
    }
}
